/*     */ package org.flashzlm.tools.analysis;
/*     */ 
/*     */ import java.util.AbstractMap;
import java.util.ArrayList;
/*     */ import java.util.Collection;
/*     */ import java.util.HashMap;
/*     */ import java.util.Iterator;
/*     */ import java.util.List;
/*     */ import java.util.Map;
import java.util.Set;


/*     */ 
/*     */ public class Gua
/*     */ {
/*     */   public static final int shaoYin = 8;
/*     */   public static final int laoYin = 6;
/*     */   public static final int shaoYang = 7;
/*     */   public static final int laoYang = 9;
/*  16 */   public static final Map<Integer, String> guaValueMap = new HashMap<Integer, String>();
/*  17 */   public static final List<String> baGuas = new ArrayList<String>();
/*     */   public static enum WuXing {
	               JIN,MU,SHUI,HUO,TU
		    };
            public static enum SK{
            	SHENG,KE,_SHENG,_KE,BIHE
            };
            
            public static final Map<Map.Entry<WuXing,WuXing>,SK> skMap=new HashMap<Map.Entry<WuXing,WuXing>,SK>();
            public static final Map<Integer,WuXing> wuXingMap=new HashMap<Integer,WuXing>();
            
            public SK duanSK(WuXing w1,WuXing w2){
            	if(w1==w2){
            		return SK.BIHE;
            	}
            	return skMap.get(new AbstractMap.SimpleEntry<WuXing,WuXing>(w1,w2));
            }
            
/*     */   static {
/*  20 */     guaValueMap.put(Integer.valueOf(0), "地为坤");
/*  21 */     guaValueMap.put(Integer.valueOf(1), "山地剥");
/*  22 */     guaValueMap.put(Integer.valueOf(2), "水地比");
/*  23 */     guaValueMap.put(Integer.valueOf(3), "风地观");
/*  24 */     guaValueMap.put(Integer.valueOf(4), "雷地豫");
/*  25 */     guaValueMap.put(Integer.valueOf(5), "火地晋");
/*  26 */     guaValueMap.put(Integer.valueOf(6), "泽地萃");
/*  27 */     guaValueMap.put(Integer.valueOf(7), "天地否");
/*  28 */     guaValueMap.put(Integer.valueOf(8), "地山谦");
/*  29 */     guaValueMap.put(Integer.valueOf(9), "山为艮");
/*     */ 
/*  31 */     guaValueMap.put(Integer.valueOf(10), "水山蹇");
/*  32 */     guaValueMap.put(Integer.valueOf(11), "风山渐");
/*  33 */     guaValueMap.put(Integer.valueOf(12), "雷山小过");
/*  34 */     guaValueMap.put(Integer.valueOf(13), "火山旅");
/*  35 */     guaValueMap.put(Integer.valueOf(14), "泽山咸");
/*  36 */     guaValueMap.put(Integer.valueOf(15), "天山遁");
/*  37 */     guaValueMap.put(Integer.valueOf(16), "地水师");
/*  38 */     guaValueMap.put(Integer.valueOf(17), "山水蒙");
/*  39 */     guaValueMap.put(Integer.valueOf(18), "水为坎");
/*  40 */     guaValueMap.put(Integer.valueOf(19), "风水涣");
/*     */ 
/*  42 */     guaValueMap.put(Integer.valueOf(20), "雷水解");
/*  43 */     guaValueMap.put(Integer.valueOf(21), "火水未济");
/*  44 */     guaValueMap.put(Integer.valueOf(22), "泽水困");
/*  45 */     guaValueMap.put(Integer.valueOf(23), "天水讼");
/*  46 */     guaValueMap.put(Integer.valueOf(24), "地风升");
/*  47 */     guaValueMap.put(Integer.valueOf(25), "山风蛊");
/*  48 */     guaValueMap.put(Integer.valueOf(26), "水风井");
/*  49 */     guaValueMap.put(Integer.valueOf(27), "风为巽");
/*  50 */     guaValueMap.put(Integer.valueOf(28), "雷风恒");
/*  51 */     guaValueMap.put(Integer.valueOf(29), "火风鼎");
/*     */ 
/*  53 */     guaValueMap.put(Integer.valueOf(30), "泽风大过");
/*  54 */     guaValueMap.put(Integer.valueOf(31), "天风姤");
/*  55 */     guaValueMap.put(Integer.valueOf(32), "地雷复");
/*  56 */     guaValueMap.put(Integer.valueOf(33), "山雷颐");
/*  57 */     guaValueMap.put(Integer.valueOf(34), "水雷屯");
/*  58 */     guaValueMap.put(Integer.valueOf(35), "风雷益");
/*  59 */     guaValueMap.put(Integer.valueOf(36), "雷为震");
/*  60 */     guaValueMap.put(Integer.valueOf(37), "火雷噬嗑");
/*  61 */     guaValueMap.put(Integer.valueOf(38), "泽雷随");
/*  62 */     guaValueMap.put(Integer.valueOf(39), "天雷无妄");
/*     */ 
/*  64 */     guaValueMap.put(Integer.valueOf(40), "地火明夷");
/*  65 */     guaValueMap.put(Integer.valueOf(41), "山火贲");
/*  66 */     guaValueMap.put(Integer.valueOf(42), "水火既济");
/*  67 */     guaValueMap.put(Integer.valueOf(43), "风火家人");
/*  68 */     guaValueMap.put(Integer.valueOf(44), "雷火丰");
/*  69 */     guaValueMap.put(Integer.valueOf(45), "火为离");
/*  70 */     guaValueMap.put(Integer.valueOf(46), "泽火革");
/*  71 */     guaValueMap.put(Integer.valueOf(47), "天火同人");
/*  72 */     guaValueMap.put(Integer.valueOf(48), "地泽临");
/*  73 */     guaValueMap.put(Integer.valueOf(49), "山泽损");
/*     */ 
/*  75 */     guaValueMap.put(Integer.valueOf(50), "水泽节");
/*  76 */     guaValueMap.put(Integer.valueOf(51), "风泽中孚");
/*  77 */     guaValueMap.put(Integer.valueOf(52), "雷泽归妹");
/*  78 */     guaValueMap.put(Integer.valueOf(53), "火泽睽");
/*  79 */     guaValueMap.put(Integer.valueOf(54), "泽为兑");
/*  80 */     guaValueMap.put(Integer.valueOf(55), "天泽履");
/*  81 */     guaValueMap.put(Integer.valueOf(56), "地天泰");
/*  82 */     guaValueMap.put(Integer.valueOf(57), "山天大畜");
/*  83 */     guaValueMap.put(Integer.valueOf(58), "水天需");
/*  84 */     guaValueMap.put(Integer.valueOf(59), "风天小畜");
/*     */ 
/*  86 */     guaValueMap.put(Integer.valueOf(60), "雷天大壮");
/*  87 */     guaValueMap.put(Integer.valueOf(61), "火天大有");
/*  88 */     guaValueMap.put(Integer.valueOf(62), "泽天夬");
/*  89 */     guaValueMap.put(Integer.valueOf(63), "天为乾");
/*     */ 
/*  91 */     baGuas.add("天为乾");
/*  92 */     baGuas.add("泽为兑");
/*  93 */     baGuas.add("火为离");
/*  94 */     baGuas.add("雷为震");
/*  95 */     baGuas.add("风为巽");
/*  96 */     baGuas.add("水为坎");
/*  97 */     baGuas.add("山为艮");
/*  98 */     baGuas.add("地为坤");

			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.JIN,WuXing.MU),SK.KE);	
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.MU,WuXing.JIN),SK._KE);
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.JIN,WuXing.SHUI),SK.SHENG);
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.SHUI,WuXing.JIN),SK._SHENG);
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.JIN,WuXing.HUO),SK._KE);			  
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.HUO,WuXing.JIN),SK.KE);				  
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.JIN,WuXing.TU),SK._SHENG);				  
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.TU,WuXing.JIN),SK.SHENG);
			  
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.MU,WuXing.SHUI),SK._SHENG);	
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.SHUI,WuXing.MU),SK.SHENG);				  
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.MU,WuXing.HUO),SK.SHENG);	
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.HUO,WuXing.MU),SK._SHENG);
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.MU,WuXing.TU),SK.KE);
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.TU,WuXing.MU),SK._KE);			  
			  
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.SHUI,WuXing.HUO),SK.KE);			  
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.HUO,WuXing.SHUI),SK._KE);
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.SHUI,WuXing.TU),SK._KE);	
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.TU,WuXing.SHUI),SK.KE);		
			  
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.HUO,WuXing.TU),SK.SHENG);				  
			  skMap.put(new AbstractMap.SimpleEntry<WuXing, WuXing>(WuXing.TU,WuXing.HUO),SK._SHENG);			  
/*     */  
			  wuXingMap.put(0, WuXing.TU);  
              wuXingMap.put(1,WuXing.TU);
              wuXingMap.put(2, WuXing.SHUI);
              wuXingMap.put(3,WuXing.MU);
              wuXingMap.put(4,WuXing.MU);
              wuXingMap.put(5,WuXing.HUO);
              wuXingMap.put(6, WuXing.JIN);
              wuXingMap.put(7, WuXing.JIN);
			}
/*     */ 
/*     */   public static String yaoValue(int yao)
/*     */   {
/* 119 */     if ((7 == yao) || (9 == yao) || (1 == yao)) return "1";
/* 120 */     if ((8 == yao) || (6 == yao) || (yao == 0)) return "0";
/* 121 */     return "error";
/*     */   }
/*     */ 
/*     */   public static String InverseYaoValue(String v) {
/* 125 */     String result = "";
/* 126 */     if (v.equals("0")) result = "1";
/*     */     else result = "0";
/* 128 */     return result;
/*     */   }
/*     */ 
/*     */   public boolean isDongYao(Integer yao)
/*     */   {
/* 134 */     return ((9 == yao.intValue()) || (6 == yao.intValue()));
/*     */   }
/*     */ 
/*     */   public List<Integer> dongYaoPos(List<Integer> sixYaos)
/*     */   {
/* 142 */     List<Integer> result = new ArrayList<Integer>();
/* 143 */     for (int i = 0; i < sixYaos.size(); ++i) {
/* 144 */       if (isDongYao((Integer)sixYaos.get(i))) {
/* 145 */         result.add(Integer.valueOf(i));
/*     */       }
/*     */     }
/*     */ 
/* 149 */     return result;
/*     */   }
/*     */   
/*     */   public List<Integer> jingYaoPos(List<Integer> sixYaos)
/*     */   {
/* 156 */     List<Integer> result = new ArrayList<Integer>();
/* 157 */     for (int i = 0; i < sixYaos.size(); ++i) {
/* 158 */       if (!(isDongYao((Integer)sixYaos.get(i)))) {
/* 159 */         result.add(Integer.valueOf(i));
/*     */       }
/*     */     }
/* 162 */     return result; }
/*     */ 
/*     */   public int guaValue(List<Integer> sixYaos) {
/* 165 */     String binValue = "";
/* 166 */     for (Iterator<Integer> localIterator = sixYaos.iterator(); localIterator.hasNext(); ) { int yao = ((Integer)localIterator.next()).intValue();
/* 167 */       binValue = binValue + yaoValue(yao);
/*     */     }
/* 169 */     return Integer.valueOf(binValue, 2).intValue();
/*     */   }
/*     */ 
            public int downGuaValue(List<Integer> sixYaos){
/* 165 */     String binValue = "";
/* 166 */     for (int i=0;i<3;++i )
              { int yao = sixYaos.get(i);
/* 167 */       binValue = binValue + yaoValue(yao);
/*     */     }
/* 169 */     return Integer.valueOf(binValue, 2).intValue();            	
            	
            }

            public int upGuaValue(List<Integer> sixYaos){
/* 165 */     String binValue = "";
/* 166 */     for (int i=3;i<6;++i )
              { int yao = sixYaos.get(i);
/* 167 */       binValue = binValue + yaoValue(yao);
/*     */     }
/* 169 */     return Integer.valueOf(binValue, 2).intValue();            	
            	            	
            }
/*     */   public String bianGua(List<Integer> sixYaos)
/*     */   {
/* 174 */     return ((String)guaValueMap.get(Integer.valueOf(bianGuaValue(sixYaos))));
/*     */   }
/*     */ 
/*     */   public int bianGuaValue(List<Integer> sixYaos)
/*     */   {
/* 179 */     String binValue = "";
/* 180 */     for (int i = 0; i < sixYaos.size(); ++i) {
/* 181 */       int yao = ((Integer)sixYaos.get(i)).intValue();
/* 182 */       String yaoValue = yaoValue(yao);
/* 183 */       boolean isDong = isDongYao(Integer.valueOf(yao));
/* 184 */       if (isDong)
/* 185 */         binValue = binValue + InverseYaoValue(yaoValue);
/*     */       else {
/* 187 */         binValue = binValue + yaoValue;
/*     */       }
/*     */     }
/* 190 */     return Integer.valueOf(binValue, 2).intValue();
/*     */   }
/*     */ 
/*     */   public static int cuoGuaValue(List<Integer> sixYaos)
/*     */   {
/* 195 */     String binValue = "";
/* 196 */     for (int i = 0; i < sixYaos.size(); ++i) {
/* 197 */       int yao = ((Integer)sixYaos.get(i)).intValue();
/* 198 */       String yaoValue = yaoValue(yao);
/* 199 */       binValue = binValue + InverseYaoValue(yaoValue);
/*     */     }
/* 201 */     return Integer.valueOf(binValue, 2).intValue();
/*     */   }
/*     */ 
/*     */   public static int zongGuaValue(List<Integer> sixYaos) {
/* 205 */     String binValue = "";
/* 206 */     for (int i = sixYaos.size() - 1; i >= 0; --i) {
/* 207 */       int yao = ((Integer)sixYaos.get(i)).intValue();
/* 208 */       binValue = binValue + yaoValue(yao);
/*     */     }
/* 210 */     return Integer.valueOf(binValue, 2).intValue();
/*     */   }
/*     */ 
/*     */   public static int jiaoHuGuaValue(List<Integer> sixYaos) {
/* 214 */     String binValue = "";
/* 215 */     for (Iterator<Integer> localIterator = sixYaos.iterator(); localIterator.hasNext(); ) { int yao = ((Integer)localIterator.next()).intValue();
/* 216 */       binValue = binValue + yaoValue(yao);
/*     */     }
/* 218 */     binValue = binValue.substring(1, 4) + binValue.substring(2, 5);
/*     */ 
/* 220 */     return Integer.valueOf(binValue, 2).intValue(); }
/*     */ 
/*     */   public boolean isQian(List<Integer> sixYaos) {
/* 223 */     boolean rtn = true;
/* 224 */     for (Iterator<Integer> localIterator = sixYaos.iterator(); localIterator.hasNext(); ) { int yao = ((Integer)localIterator.next()).intValue();
/* 225 */       if ("0".equals(yaoValue(yao))) {
/* 226 */         rtn = false;
/* 227 */         break;
/*     */       }
/*     */     }
/* 230 */     return rtn;
/*     */   }
/*     */ 
/*     */   public boolean isKun(List<Integer> sixYaos) {
/* 234 */     boolean rtn = true;
/* 235 */     for (Iterator<Integer> localIterator = sixYaos.iterator(); localIterator.hasNext(); ) { int yao = ((Integer)localIterator.next()).intValue();
/* 236 */       if ("1".equals(yaoValue(yao))) {
/* 237 */         rtn = false;
/* 238 */         break;
/*     */       }
/*     */     }
/* 241 */     return rtn;
/*     */   }
/*     */ 
/*     */   public String isDeWei(List<Integer> sixYaos, int n) {
/* 245 */     String result = "";
/* 246 */     int yao = ((Integer)sixYaos.get(n - 1)).intValue();
/* 247 */     String yv = yaoValue(yao);
/* 248 */     if (yv.equals("1"))
/* 249 */       result = "阳";
/*     */     else {
/* 251 */       result = "阴";
/*     */     }
/* 253 */     if (n % 2 == 1)
/* 254 */       result = result + "居阳位";
/*     */     else {
/* 256 */       result = result + "居阴位";
/*     */     }
/*     */ 
/* 259 */     return result;
/*     */   }
/*     */ 

           public static enum TiYongGuanXi{
        	   biHe,tiKeYong,tiShengYong,yongKeTi,yongShengTi,NONE
           }

           public TiYongGuanXi duanTiYong(List<Integer> sixYaos){
        	   int up=upGuaValue(sixYaos);
        	   int down=downGuaValue(sixYaos);
        	   WuXing upw=wuXingMap.get(up);
        	   WuXing downw=wuXingMap.get(down);
        	   int dongPos=duanDongYao(sixYaos);
        	   boolean upIsTi=false;
        	   if(dongPos==0||dongPos==7){
        		   
        		   return TiYongGuanXi.NONE;
        	   }else if(dongPos<4){
        		   upIsTi=true;
        		   
        	   }else{
        		   upIsTi=false;
        	   }
        	   SK sk=duanSK(upw,downw);
        	   switch(sk){
        	   case BIHE:
        		   return TiYongGuanXi.biHe;
        	   case SHENG:
        		   if(upIsTi){
        			   return TiYongGuanXi.tiShengYong;
        			   
        		   }else{
        			   return TiYongGuanXi.yongShengTi;
        		   }
        	   case KE:
        		   if(upIsTi){
        			   return TiYongGuanXi.tiKeYong;
        			   
        		   }else{
        			   return TiYongGuanXi.yongKeTi;
        		   }
        	   case _SHENG:
        		   if(upIsTi){
        			   return TiYongGuanXi.yongShengTi;
        			   
        		   }else{
        			   return TiYongGuanXi.tiShengYong;
        		   }
        	   case _KE:
        		   if(upIsTi){
        			   return TiYongGuanXi.yongKeTi;
        			   
        		   }else{
        			   return TiYongGuanXi.tiKeYong;
        		   }
        	   }
        	   
        	   return TiYongGuanXi.NONE;
           }
            
           public String transTiYong(TiYongGuanXi tygx){
        	   switch(tygx){
        	   case biHe:
        		   return "比和,吉";
        	   case tiKeYong:
        		   return "体克用,吉";
        	   case tiShengYong:
        		   return "体生用,吉";
        	   case yongKeTi:
        		   return "用克体,不吉";
        	   case yongShengTi:
        		   return "用生体,不吉";
        	   case NONE:
        		   
        		default:
        			return "体用无生克比合";
        	   }
           }


/*     */   public int duanDongYao(List<Integer> sixYaos)
/*     */   {
/* 264 */     List<Integer> dyPos = dongYaoPos(sixYaos);
/* 265 */     List<Integer> jyPos = jingYaoPos(sixYaos);
/*     */ 
/* 267 */     int result = 8;
/*     */     int n;
/* 271 */     switch (dyPos.size())
/*     */     {
/*     */     case 0:
/* 273 */       result = 0; break;
/*     */     case 1:
/* 274 */       n = ((Integer)dyPos.get(0)).intValue();
/* 275 */       ++n;
/*     */ 
/* 277 */       result = n;
/* 278 */       break;
/*     */     case 2:
/* 280 */       int n1 = ((Integer)dyPos.get(0)).intValue();
/* 281 */       int n2 = ((Integer)dyPos.get(1)).intValue();
/* 282 */       int yao1 = ((Integer)sixYaos.get(n1)).intValue();
/* 283 */       int yao2 = ((Integer)sixYaos.get(n2)).intValue();
/* 284 */       String yao1Value = yaoValue(yao1);
/* 285 */       String yao2Value = yaoValue(yao2);
/* 286 */       if (!(yao1Value.equals(yao2Value))) {
/* 287 */         if (yao1Value.equals("0")) {
/* 288 */           ++n1;
/*     */ 
/* 290 */           result = n1;
/* 291 */           break;
/*     */         }
/* 293 */         ++n2;
/*     */ 
/* 295 */         result = n2;
/* 296 */         break;
/*     */       }
/*     */ 
/* 299 */       if (n1 < n2) {
/* 300 */         ++n2;
/*     */ 
/* 302 */         result = n2;
/* 303 */         break;
/*     */       }
/* 305 */       ++n1;
/*     */ 
/* 307 */       result = n1;
/* 308 */       break;
/*     */     case 3:
/* 311 */       n = ((Integer)dyPos.get(1)).intValue();
/* 312 */       ++n;
/*     */ 
/* 314 */       result = n;
/* 315 */       break;
/*     */     case 4:
/* 316 */       n = ((Integer)jyPos.get(0)).intValue();
/* 317 */       ++n;
/*     */ 
/* 319 */       result = n;
/* 320 */       break;
/*     */     case 5:
/* 321 */       n = ((Integer)jyPos.get(0)).intValue();
/* 322 */       ++n;
/*     */ 
/* 324 */       result = n;
/* 325 */       break;
/*     */     case 6:
/* 336 */       result = 7;
/*     */     }
/*     */ 
/* 340 */    return result;
/*     */   }
/*     */ 
/*     */   public String duanGua(List<Integer> sixYaos, int dongY) {
/* 344 */     String duan = "";
/* 345 */     switch (dongY)
/*     */     {
/*     */     case 0:
/* 347 */       duan = "卦辞";
/* 348 */       break;
/*     */     case 7:
/* 350 */       if (isQian(sixYaos)) {
/* 351 */         duan = "用九辞"; break; }
/* 352 */       if (isKun(sixYaos)) {
/* 353 */         duan = "用六辞"; break;
/*     */       }
/* 355 */       String bianG = bianGua(sixYaos);
/* 356 */       duan = "变卦->" + bianG + "的彖辞";
/*     */ 
/* 358 */       break;
/*     */     case 1:
/*     */     case 2:
/*     */     case 3:
/*     */     case 4:
/*     */     case 5:
/*     */     case 6:
/* 365 */       duan = "第" + dongY + "爻的爻辞，" + isDeWei(sixYaos, dongY);
/*     */     }
/*     */ 
/* 368 */      return duan;
/*     */   }
/*     */ 
/*     */   public static String getChongGua(String he) {
/* 372 */     if (he.equals("天天"))
/* 373 */       he = "天为";
/* 374 */     else if (he.equals("地地"))
/* 375 */       he = "地为";
/* 376 */     else if (he.equals("风风"))
/* 377 */       he = "风为";
/* 378 */     else if (he.equals("山山"))
/* 379 */       he = "山为";
/* 380 */     else if (he.equals("雷雷"))
/* 381 */       he = "雷为";
/* 382 */     else if (he.equals("泽泽"))
/* 383 */       he = "泽为";
/* 384 */     else if (he.equals("火火"))
/* 385 */       he = "火为";
/* 386 */     else if (he.equals("水水")) {
/* 387 */       he = "水为";
/*     */     }
/*     */ 
/* 390 */     Collection<String> gns = guaValueMap.values();
/*     */ 
/* 392 */     for (String gn : gns) {
/* 393 */       if (gn.substring(0, 2).equals(he)) {
/* 394 */         return gn;
/*     */       }
/*     */     }
/* 397 */     return null;
/*     */   }
/*     */ 
/*     */   public static int getGuaValue(String gn) {
/* 401 */     Set<Integer> gvs = guaValueMap.keySet();
/* 402 */     for (Iterator<Integer> localIterator = gvs.iterator(); localIterator.hasNext(); ) { int gv = ((Integer)localIterator.next()).intValue();
/* 403 */       String n = (String)guaValueMap.get(Integer.valueOf(gv));
/* 404 */       if (gn.equals(n)) {
/* 405 */         return gv;
/*     */       }
/*     */     }
/* 408 */     return 64;
/*     */   }
/*     */ 
/*     */   public static List<Integer> getSixYaos(int guaValue)
/*     */   {
/* 416 */     String binv = Integer.toString(guaValue, 2);
/* 417 */     if (binv.length() < 6) {
/* 418 */       int n = 6 - binv.length();
/* 419 */       for (int i = 0; i < n; ++i) {
/* 420 */         binv = "0" + binv;
/*     */       }
/*     */     }
/* 423 */     List<Integer> sixYaos = new ArrayList<Integer>();
/* 424 */     for (int i = 0; i < 6; ++i) {
/* 425 */       Character a = Character.valueOf(binv.charAt(i));
/* 426 */       sixYaos.add(Integer.valueOf(Integer.parseInt(a.toString())));
/*     */     }
/* 428 */     return sixYaos;
/*     */   }
/*     */ }

